package com.example.mardan.repository;

import java.io.IOException;

import okhttp3.OkHttpClient;
import okhttp3.Request;

public class SongciRepository {
    private static final String BASE_URL = "https://api.jisuapi.com/songci/chapter?appkey=31909fc69575bf5b";

    private final OkHttpClient okHttpClient;

    public SongciRepository(OkHttpClient okHttpClient) {
        this.okHttpClient = okHttpClient;
    }

    public void getSongciChapter(String appKey, okhttp3.Callback callback) {
        String url = BASE_URL + appKey;
        Request request = new Request.Builder().url(url).build();
        okHttpClient.newCall(request).enqueue(callback);
    }

    public interface Callback {
        void onResponse(String response);
        void onFailure(IOException e);
    }
}
